package com.youlu.campus.service.platform.impl;

import com.youlu.campus.entity.PlatformComplaintConfig;
import com.youlu.campus.service.platform.PlatformComplaintConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class PlatformComplaintConfigServiceImpl implements PlatformComplaintConfigService {
    @Autowired
    private MongoTemplate mongoTemplate;

    @Override
    public PlatformComplaintConfig find() {
        Query query = new Query();
        query.addCriteria(Criteria.where("deleted").ne(Boolean.TRUE));
        return mongoTemplate.findOne(query, PlatformComplaintConfig.class);
    }
}
